package me.yushuai.wukong.base.entity;

import lombok.*;
import me.yushuai.wukong.common.domain.AbstractAudit;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 库区
 *
 * @author zhoushuai@189.cn
 * @TableName BAS_ZONE
 */
@Getter
@Setter
@Entity
@ToString
@Table(name = "BAS_ZONE")
public class Zone extends AbstractAudit implements Serializable {
    /**
     * 库区编号
     */
    @Id
    @Column(name = "ZONE_ID")
    private Long zoneId;

    /**
     * 库区编码
     */
    @Column(name = "ZONE_CODE", nullable = false, updatable = false)
    private String bizId;

    /**
     * 库区所属区域
     */
    @Column(name = "ZONE_GROUP_ID", nullable = false, updatable = false)
    private Long zoneGroupId;

    /**
     * 库区描述
     */
    @Column(name = "DESC_CH")
    private String descCh;

    /**
     * 入库过渡库位
     */
    @Column(name = "PUT_AWAY_TO_LOC")
    private String putAwayToLoc;

    /**
     * 拣货过渡库位
     */
    @Column(name = "PICK_TO_LOC")
    private String pickToLoc;

    /**
     *
     */
    @Column(name = "CUBAGE")
    private BigDecimal cubage;

    /**
     * 设施
     */
    @Column(name = "FACILITY_ID")
    private String facilityId;

    /**
     * 库区基点
     */
    @Column(name = "BASE_LOCATION")
    private String baseLocation;

    /**
     * 运输方式
     */
    @Column(name = "ROUTE")
    private String route;

    /**
     * 整箱补货来源
     */
    @Type(type = "yes_no")
    @Column(name = "ALLOW_CS_RPL")
    private Boolean allowCsRpl;

    /**
     * 拆零补货来源
     */
    @Type(type = "yes_no")
    @Column(name = "ALLOW_EA_RPL")
    private Boolean allowEaRpl;

    /**
     * 日期型动态属性01
     */
    @Column(name = "DADD01")
    private LocalDateTime dadd01;

    /**
     * 日期型动态属性02
     */
    @Column(name = "DADD02")
    private LocalDateTime dadd02;

    /**
     * 日期型动态属性03
     */
    @Column(name = "DADD03")
    private LocalDateTime dadd03;

    /**
     * 日期型动态属性04
     */
    @Column(name = "DADD04")
    private LocalDateTime dadd04;

    /**
     * 日期时间型动态属性01
     */
    @Column(name = "DADT01")
    private LocalDateTime dadt01;

    /**
     * 日期时间型动态属性02
     */
    @Column(name = "DADT02")
    private LocalDateTime dadt02;

    /**
     * 日期时间型动态属性03
     */
    @Column(name = "DADT03")
    private LocalDateTime dadt03;

    /**
     * 日期时间型动态属性04
     */
    @Column(name = "DADT04")
    private LocalDateTime dadt04;

    /**
     * 字符串型动态属性01
     */
    @Column(name = "DAVR01")
    private String davr01;

    /**
     * 字符串型动态属性02
     */
    @Column(name = "DAVR02")
    private String davr02;

    /**
     * 字符串型动态属性03
     */
    @Column(name = "DAVR03")
    private String davr03;

    /**
     * 字符串型动态属性04
     */
    @Column(name = "DAVR04")
    private String davr04;

    /**
     * 字符型动态属性01
     */
    @Column(name = "DACH01")
    private String dach01;

    /**
     * 字符型动态属性01
     */
    @Column(name = "DACH02")
    private String dach02;

    /**
     * 字符型动态属性01
     */
    @Column(name = "DACH03")
    private String dach03;

    /**
     * 字符型动态属性01
     */
    @Column(name = "DACH04")
    private String dach04;

    /**
     * 整型动态属性01
     */
    @Column(name = "DAIN01")
    private BigDecimal dain01;

    /**
     * 整型动态属性02
     */
    @Column(name = "DAIN02")
    private BigDecimal dain02;

    /**
     * 整型动态属性03
     */
    @Column(name = "DAIN03")
    private BigDecimal dain03;

    /**
     * 整型动态属性04
     */
    @Column(name = "DAIN04")
    private BigDecimal dain04;

    /**
     * 浮点型动态属性01
     */
    @Column(name = "DAFL01")
    private BigDecimal dafl01;

    /**
     * 浮点型动态属性01
     */
    @Column(name = "DAFL02")
    private BigDecimal dafl02;

    /**
     * 浮点型动态属性01
     */
    @Column(name = "DAFL03")
    private BigDecimal dafl03;

    /**
     * 浮点型动态属性01
     */
    @Column(name = "DAFL04")
    private BigDecimal dafl04;

    /**
     * 备注说明
     */
    @Column(name = "NOTES")
    private String notes;

    /**
     * 自定义01
     */
    @Column(name = "UDF01")
    private String udf01;

    /**
     * 自定义02
     */
    @Column(name = "UDF02")
    private String udf02;

    /**
     * 自定义03
     */
    @Column(name = "UDF03")
    private String udf03;

    /**
     * 自定义04
     */
    @Column(name = "UDF04")
    private String udf04;

    /**
     * 自定义05
     */
    @Column(name = "UDF05")
    private String udf05;

    /**
     * 自定义06
     */
    @Column(name = "UDF06")
    private String udf06;

    /**
     * 自定义07
     */
    @Column(name = "UDF07")
    private String udf07;

    /**
     * 自定义08
     */
    @Column(name = "UDF08")
    private String udf08;

    /**
     * 当前版本号
     */
    @Version
    @Column(name = "CUR_VER_NO")
    private Long curVerNo;

    /**
     * 操作流水号标记
     */
    @Column(name = "OPRSEQFG")
    private String oprseqfg;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        Zone zone = (Zone) o;
        return Objects.equals(getZoneId(), zone.getZoneId())
                && Objects.equals(getBizId(), zone.getBizId())
                && Objects.equals(getZoneGroupId(), zone.getZoneGroupId())
                && Objects.equals(getDescCh(), zone.getDescCh())
                && Objects.equals(getPutAwayToLoc(), zone.getPutAwayToLoc())
                && Objects.equals(getPickToLoc(), zone.getPickToLoc())
                && Objects.equals(getCubage(), zone.getCubage())
                && Objects.equals(getFacilityId(), zone.getFacilityId())
                && Objects.equals(getBaseLocation(), zone.getBaseLocation())
                && Objects.equals(getRoute(), zone.getRoute())
                && Objects.equals(getAllowCsRpl(), zone.getAllowCsRpl())
                && Objects.equals(getAllowEaRpl(), zone.getAllowEaRpl())
                && Objects.equals(getDadd01(), zone.getDadd01())
                && Objects.equals(getDadd02(), zone.getDadd02())
                && Objects.equals(getDadd03(), zone.getDadd03())
                && Objects.equals(getDadd04(), zone.getDadd04())
                && Objects.equals(getDadt01(), zone.getDadt01())
                && Objects.equals(getDadt02(), zone.getDadt02())
                && Objects.equals(getDadt03(), zone.getDadt03())
                && Objects.equals(getDadt04(), zone.getDadt04())
                && Objects.equals(getDavr01(), zone.getDavr01())
                && Objects.equals(getDavr02(), zone.getDavr02())
                && Objects.equals(getDavr03(), zone.getDavr03())
                && Objects.equals(getDavr04(), zone.getDavr04())
                && Objects.equals(getDach01(), zone.getDach01())
                && Objects.equals(getDach02(), zone.getDach02())
                && Objects.equals(getDach03(), zone.getDach03())
                && Objects.equals(getDach04(), zone.getDach04())
                && Objects.equals(getDain01(), zone.getDain01())
                && Objects.equals(getDain02(), zone.getDain02())
                && Objects.equals(getDain03(), zone.getDain03())
                && Objects.equals(getDain04(), zone.getDain04())
                && Objects.equals(getDafl01(), zone.getDafl01())
                && Objects.equals(getDafl02(), zone.getDafl02())
                && Objects.equals(getDafl03(), zone.getDafl03())
                && Objects.equals(getDafl04(), zone.getDafl04())
                && Objects.equals(getNotes(), zone.getNotes())
                && Objects.equals(getUdf01(), zone.getUdf01())
                && Objects.equals(getUdf02(), zone.getUdf02())
                && Objects.equals(getUdf03(), zone.getUdf03())
                && Objects.equals(getUdf04(), zone.getUdf04())
                && Objects.equals(getUdf05(), zone.getUdf05())
                && Objects.equals(getUdf06(), zone.getUdf06())
                && Objects.equals(getUdf07(), zone.getUdf07())
                && Objects.equals(getUdf08(), zone.getUdf08())
                && Objects.equals(getCurVerNo(), zone.getCurVerNo())
                && Objects.equals(getOprseqfg(), zone.getOprseqfg());
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), getZoneId(), getBizId(), getZoneGroupId(), getDescCh(), getPutAwayToLoc()
                , getPickToLoc(), getCubage(), getFacilityId(), getBaseLocation(), getRoute(), getAllowCsRpl()
                , getAllowEaRpl(), getDadd01(), getDadd02(), getDadd03(), getDadd04(), getDadt01(), getDadt02()
                , getDadt03(), getDadt04(), getDavr01(), getDavr02(), getDavr03(), getDavr04(), getDach01()
                , getDach02(), getDach03(), getDach04(), getDain01(), getDain02(), getDain03(), getDain04()
                , getDafl01(), getDafl02(), getDafl03(), getDafl04(), getNotes(), getUdf01(), getUdf02()
                , getUdf03(), getUdf04(), getUdf05(), getUdf06(), getUdf07(), getUdf08(), getCurVerNo()
                , getOprseqfg());
    }
}